<?php

namespace SC\Qiniu;

use Illuminate\Support\Str;
use Illuminate\Support\ServiceProvider;


class QiniuServiceProvider extends ServiceProvider
{
    function register()
    {
        if ($this->app->runningInConsole()) {
            if ($files = scandir(realpath(__DIR__ . '/Console'))) {
                $commands = [];
                foreach($files as $file) {
                    if (Str::endsWith($file, '.php')) {
                        $commands[] = 'SC\\Qiniu\\Console\\' . str_replace('.php', '', $file);
                    }
                }
                $this->commands($commands);
            }
        }
    }

    function boot()
    {

    }
}